package cn.owen.util;

import org.apache.commons.httpclient.HttpClient;  
import org.apache.commons.httpclient.HttpStatus; 
import org.apache.commons.httpclient.methods.GetMethod;

public class Tools {
	private static HttpClient client;  
    private static GetMethod getMethod;  
    static {  
        client = new HttpClient();  
    }  
    public static String getStaticString(String URL){
    	 getMethod = new GetMethod(URL); 
    	 String jsonText="";
    	 try {  
             int status = client.executeMethod(getMethod);  
             if (status == HttpStatus.SC_OK) {// HTTP 200 OK  
                 jsonText = getMethod.getResponseBodyAsString(); 
             }  
         } catch (Exception e) {  
             System.err.println(e);  
         }  
    	 return jsonText;
    }
}
